home *** CD-ROM | disk | FTP | other *** search
/ Euroscene 2 / Euroscene 2.iso / USEFUL / DeliTracker130 / Developer / Developer.run / Examples / SIDMon1.0.s < prev    next >
Encoding:
Text File  |  1992-09-23  |  2.9 KB  |  156 lines

  1.  
  2.     incdir    "Includes:"
  3.     include "misc/DeliPlayer.i"
  4.  
  5. ;
  6. ;
  7.     SECTION Player,Code
  8. ;
  9. ;
  10.  
  11.     PLAYERHEADER PlayerTagArray
  12.  
  13.     dc.b '$VER: SIDMon 1.0 player module V1.2 (02 Aug 92)',0
  14.     even
  15.  
  16. PlayerTagArray
  17.     dc.l    DTP_PlayerVersion,2
  18.     dc.l    DTP_PlayerName,PName
  19.     dc.l    DTP_Creator,CName
  20.     dc.l    DTP_Check2,Chk
  21.     dc.l    DTP_Interrupt,Int
  22.     dc.l    DTP_InitPlayer,InitPlay
  23.     dc.l    DTP_EndPlayer,EndPlay
  24.     dc.l    DTP_InitSound,InitSnd
  25.     dc.l    DTP_EndSound,RemSnd
  26.     dc.l    TAG_DONE
  27.  
  28. *-----------------------------------------------------------------------*
  29. ;
  30. ; Player/Creatorname und lokale Daten
  31.  
  32. PName    dc.b 'SIDMon_1.0',0
  33. CName    dc.b 'Reiner van Vliet,',10
  34.     dc.b 'adapted by Delirium',0
  35.     even
  36.  
  37. sm_offset1a    dc.l 0
  38. sm_offset1b    dc.l 0
  39. sm_offset2a    dc.l 0
  40. sm_offset2b    dc.l 0
  41.  
  42. *-----------------------------------------------------------------------*
  43. ;
  44. ;Interrupt für Replay
  45.  
  46. Int
  47.     movem.l    d0-d7/a0-a6,-(sp)
  48.     move.l    sm_offset2a(pc),a0
  49.     jsr    (a0)                 ; DudelDiDum
  50.     movem.l    (sp)+,d0-d7/a0-a6
  51.     rts
  52.  
  53. *-----------------------------------------------------------------------*
  54. ;
  55. ; Testet, ob es sich um ein SIDMon1.0-Modul handelt
  56.  
  57. Chk
  58.     move.l    dtg_ChkData(a5),a0
  59.  
  60.     moveq    #-1,d0                ; Modul nicht erkannt (default)
  61.  
  62.     cmpi.l    #$08f90001,$0(a0)        ; bset - Instruction
  63.     bne.s    Chk2
  64.     cmpi.l    #$00bfe001,$4(a0)
  65.     bne.s    Chk2
  66.  
  67.     cmpi.w    #$4e75,$25c(a0)            ; RTS ?
  68.     beq.s    ChkOk1
  69.     cmpi.w    #$4ef9,$25c(a0)            ; JMP ?
  70.     bne.s    Chk2
  71.     move.w    #$4e75,$25c(a0)            ; RTS -> JMP
  72. ChkOk1
  73.     moveq    #$2c,d1
  74.     move.l    #$16a,d2
  75.     bra.s    ChkOk
  76. Chk2
  77.     cmpi.w    #$41fa,$0(a0)            ; lea - Instruction
  78.     bne.s    ChkEnd
  79.     cmpi.w    #$d1e8,$4(a0)            ; add - Instruction
  80.     bne.s    ChkEnd
  81.  
  82.     cmpi.w    #$4e75,$230(a0)            ; RTS ?
  83.     beq.s    ChkOk2
  84.     cmpi.w    #$4ef9,$230(a0)            ; JMP ?
  85.     bne.s    Chk3
  86.     move.w    #$4e75,$230(a0)            ; RTS -> JMP
  87. ChkOk2
  88.     moveq    #0,d1
  89.     move.l    #$13e,d2
  90.     bra.s    ChkOk
  91. Chk3
  92.     cmpi.w    #$4e75,$29c(a0)            ; RTS ?
  93.     beq.s    ChkOk3
  94.     cmpi.w    #$4ef9,$29c(a0)            ; JMP ?
  95.     bne.s    ChkEnd
  96.     move.w    #$4e75,$29c(a0)            ; RTS -> JMP
  97. ChkOk3
  98.     moveq    #0,d1
  99.     move.l    #$16a,d2
  100. ChkOk
  101.     moveq    #0,d0                ; Modul erkannt
  102.     add.l    a0,d1
  103.     move.l    d1,sm_offset1b            ; Offset 1
  104.     add.l    a0,d2
  105.     move.l    d2,sm_offset2b            ; Offset 2
  106. ChkEnd
  107.     rts
  108.  
  109. *-----------------------------------------------------------------------*
  110. ;
  111. ; Init Player
  112.  
  113. InitPlay
  114.     move.l    sm_offset1b(pc),sm_offset1a    ; copy buffer
  115.     move.l    sm_offset2b(pc),sm_offset2a    ; copy buffer
  116.  
  117.     move.l    dtg_AudioAlloc(a5),a0        ; Function
  118.     jsr    (a0)                ; returncode is already set !
  119.     rts
  120.  
  121. *-----------------------------------------------------------------------*
  122. ;
  123. ; End Player
  124.  
  125. EndPlay
  126.     move.l    dtg_AudioFree(a5),a0        ; Function
  127.     jsr    (a0)
  128.     rts
  129.  
  130. *-----------------------------------------------------------------------*
  131. ;
  132. ; Init Sound
  133.  
  134. InitSnd
  135.     move.l    sm_offset1a(pc),a0
  136.     jsr    (a0)                ; Init Sound
  137.     rts
  138.  
  139. *-----------------------------------------------------------------------*
  140. ;
  141. ; Remove Sound
  142.  
  143. RemSnd
  144.     lea    $dff000,a0
  145.     moveq    #0,d0
  146.     move.w    d0,$a8(a0)
  147.     move.w    d0,$b8(a0)
  148.     move.w    d0,$c8(a0)
  149.     move.w    d0,$d8(a0)
  150.     move.w    #$000F,$96(a0)            ; End Sound
  151.     rts
  152.  
  153. *-----------------------------------------------------------------------*
  154.  
  155.  
  156.